<%@page import="calendar.CalendarVo"%>
<%@page import="calendar.CalendarMyba"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%request.setCharacterEncoding("utf-8"); %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />  
<link href="${pageContext.request.contextPath}/homepage/calendar/js&css/calendar.css" rel="stylesheet" type="text/css">  
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/FullCalendar/jquery.ui.datepicker-ko.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/homepage/calendar/js&css/calendar.js"></script>
<title>Insert title here</title>
</head>
<body>
<jsp:useBean id="cv" class="calendar.CalendarVo"/>
<jsp:setProperty property="*" name="cv"/>
<%
	CalendarMyba cm = new CalendarMyba();
	cm.setCv(cv);
	CalendarVo vo = cm.view();
%>
<c:set var="vo" value="<%=vo %>"></c:set>
<form name="aform" method="post" action="${pageContext.request.contextPath}/homepage/calendar/calendar_edit_result.jsp"
				onsubmit="return fnVaild(this)" style="margin: 0px">
			<input type="hidden" name="cal_no" value="${vo.cal_no }">
			<div id="calWE">
				<div id="calWE-top">
					<h1>일정 수정</h1>
				</div>
				<div id="calWE-table">
					<div class="calWE-row">
						<p class="calWE-col">일정 시작 날짜</p>
						<p><input type="text" id="startDate" name = "cal_startdt" readonly="readonly" style="width: 150px;" value="${vo.cal_startdt }"></p>
						<p class="calWE-col">일정 마지막 날짜</p>
						<p><input type="text" id="endDate" name = "cal_enddt" readonly="readonly" style="width: 150px;" value="${vo.cal_enddt }"></p>
					</div>
					<div class="calWE-row">
						<p class="calWE-col">일정 명</p>
						<p style="border-right: none;">
							<input type = "text" name = "cal_title" maxlength = "20" style="width: 100%;" value="${vo.cal_title }"/>
						</p>
						<p style="border-left: none; border-right: none; padding-left: 30px;"><font style="color: red;">(한글 최대 20자)</font></p>
						<p style="border-left: none;"></p>
					</div>
					<div class="calWE-row">
						<p class="calWE-col">글자 색</p>
						<p>
							<select name = "cal_font_color" id="cal_font_color" style="width: 150px;">
								<option value= "black" style="color: black;" selected="selected">검정색</option>
								<option value = "white" style="color: white;">흰색</option>
								<option value = "red" style="color: red;">빨강색</option>
								<option value = "blue" style="color: blue;">파랑색</option>
								<option value = "green" style="color: green;">초록색</option>
								<option value = "aqua" style="color: aqua;">바다색</option>
							</select>
						</p>
						<p class="calWE-col">배경 색</p>
						<p>
							<select name = "cal_back_color" id="cal_back_color" style="width: 150px;">
								<option value = "aqua" style="background-color: aqua;" selected="selected">바다색</option>
								<option value= "black" style="background-color: black;">검정색</option>
								<option value = "white" style="background-color: white;">하얀색</option>
								<option value = "red" style="background-color:red;">빨강색</option>
								<option value = "blue" style="background-color: blue;">파랑색</option>
								<option value = "green" style="background-color: green;">초록색</option>
							</select>
						</p>
					</div>
				</div>
				<div id="cw-bottom">
					<input type="submit" value="수정" />
					<input type="button" value="목록" onclick="location.href='${pageContext.request.contextPath}/homepage/index.jsp?inc_content=./calendar/calendar_list.jsp'">
				</div>
			</div>
	</form>
	
<script type="text/javascript">
	window.onload = function(){
		var cfc = document.getElementById("cal_font_color");
		var cbc = document.getElementById("cal_back_color");
		for(var i=0; i<cfc.length;i++){
			if(cfc.options[i].value == "${vo.cal_font_color}"){
				cfc.options[i].selected = true;
			}
		}
		for(var i=0; i<cbc.length;i++){
			if(cbc.options[i].value == "${vo.cal_back_color}"){
				cbc.options[i].selected = true;
			}
		}
	}
</script>
</body>
</html>